﻿using InvestmentIntelligence.SchedulingService.Infrastructure;
using InvestmentIntelligence.TradingData.Adapters.Mus.DataGenerators;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using InvestmentIntelligence.TradingData.DataProcessing.DataResolvers;

namespace InvestmentIntelligence.TradingData.Adapters.Mus.HandlerFactories
{
    [Export(typeof (IScheduledTaskFactory))]
    [ExportMetadata("TaskName", "GenerateNewTrades")]
    public class MusTradingDataGeneratorHandlerFactory : FolderBasedHandlerFactoryBase, IScheduledTaskFactory
    {
        public override IEnumerable<ScheduledTaskParameter> GetParameters()
        {
            yield break;
        }
        
        public override IScheduledTask CreateTask(CreateTaskParams createTaskParams, IDictionary<ScheduledTaskParameter, string> arguments)
        {
            const int bookId = 2; //todo: add parameter
            var securitiesMapper = new SecurityInfoMapper();
            var timeSeriesMapper = new TimeSerieInfoMapper();
            return new TradesGenerator(bookId, securitiesMapper, timeSeriesMapper);
        }
    }
}